44c220b54b5c69fe3fd7ebdcd288076ea459d683,src/net/java/sip/communicator/impl/protocol/sip/sdp/SdpUtils.java,SdpUtils,createFormat,#String#Attribute#Attribute#,122

Before Change


        String encoding = tokenizer.nextToken();

        //clock rate (mandatory)
        if(! tokenizer.hasMoreTokens())
            return null;
        int clockRate = Integer.parseInt(tokenizer.nextToken());

        //number of channels (optional)

After Change


        int clockRate = -1;
        int numChannels = 1;

        if (rtpmap != null)
        {
            String rtpmapValue = rtpmap.getValue();

            //rtpmapValue looks sth like this: "98 H264/90000" or
            //"97 speex/16000/2" we need to extract the encoding name, the clock
            // rate and the number of channels if any
            // if at any point we determine there's something wrong with the
            // rtpmap we bail out and try to create a format based on the
            // payloadType only.

            //first strip the payload type
            StringTokenizer tokenizer
                = new StringTokenizer(rtpmapValue, " /", false);

            //skip payload type number (mandatory)
            if(tokenizer.hasMoreTokens())
            {
                tokenizer.nextToken();
            }

            //encoding name (mandatory)
            if(tokenizer.hasMoreTokens())
            {
                encoding = tokenizer.nextToken();
            }

            //clock rate (mandatory)
            if(tokenizer.hasMoreTokens())
            {
                clockRate = Integer.parseInt(tokenizer.nextToken());
            }